------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\mdnieman\Desktop\SS Rep\SMPO_MC_SS.log
  log type:  text
 opened on:  29 May 2018, 16:20:25

. /*******************************/
> /*  Mark David Nieman  */
> /*  1/21/2016          */
> /*  Strategic Logit, Strategic Probit, Split-sample Logit, 
>                 Split-Sample Probit, Traditional Logit, Traditional Probit  */
> /*  DGP: strategic */
> /*  Monte Carlos & Comparisons (Clarke distribution-free test) */
> /*  Stata 12.1        */
> /*******************************/
> 
> #delimit;
delimiter now ;
. clear;

. clear matrix;

. clear mata;

. program drop _all;

. set seed 1999;

. /* Estimators */
>         /* strategic logit */
>                 #delimit;
delimiter now ;
.                 program define sl_lf, rclass;
  1.                         args lnf A_L A_Rr B_Rr;
  2.                         tempvar pB_r pA_R ;
  3.                                 quietly gen double `pB_r' = (exp(`B_Rr'))/(1+exp(`B_Rr'));
  4.                                 quietly gen double `pA_R' = (exp(`pB_r'*`A_Rr'))/(exp(`A_L')+exp(`pB_r'*`A_Rr'));
  5.                                                 quietly replace `lnf' = ln((1-`pA_R')) if $ML_y1==0;
  6.                         quietly replace `lnf' = ln((`pA_R')*(1-`pB_r')) if $ML_y1==1;
  7.                         quietly replace `lnf' = ln((`pA_R')*(`pB_r')) if $ML_y1==2;
  8.                 end;

.                         /* strategic logit with partial observability */
>                 #delimit;
delimiter now ;
.                 program define slpo_lf, rclass;
  1.                         args lnf A_L A_Rr B_Rr;
  2.                         tempvar pB_r pA_R ;
  3.                                 quietly gen double `pB_r' = (exp(`B_Rr'))/(1+exp(`B_Rr'));
  4.                                 quietly gen double `pA_R' = (exp(`pB_r'*`A_Rr'))/(exp(`A_L')+exp(`pB_r'*`A_Rr'));
  5.                                                 quietly replace `lnf' = ln((1-`pA_R') + (`pA_R')*(1-`pB_r')) if $ML_y1==0;
  6.                         quietly replace `lnf' = ln((`pA_R')*(`pB_r')) if $ML_y1==1;
  7.                 end;

.                 /* create the split-sample logit */
>                 #delimit;
delimiter now ;
.                 program define ssl_lf, rclass;
  1.                                         args lnf gamma beta;
  2.                         tempvar rel out;
  3.                                 quietly gen double `rel' = exp(`gamma')/(1+exp(`gamma'));
  4.                                 quietly gen double `out' = exp(`beta')/(1+exp(`beta'));
  5.                         quietly replace `lnf' = ln((1-`rel')+(`rel'*(1-`out'))) if $ML_y1==0;
  6.                                 quietly replace `lnf' = ln((`rel')*(`out')) if $ML_y1==1;
  7.                 end;

.         #delimit;
delimiter now ;
. /* program to generate y */
> program define mc_strat, rclass;
  1.   syntax, indvars(string);
  2.         use "`indvars'.dta", clear;
  3. #delimit;
delimiter now ;
.         /* Agent Error - Gumble Dist (Type 1 Extreme Value) */
>         gen double u_r = -ln(-ln(runiform()));
  4.         gen double u_l = -ln(-ln(runiform()));
  5.         gen double u_R = -ln(-ln(runiform()));
  6.         gen double u_L = -ln(-ln(runiform()));
  7.                 /* Player B Utilities */
>         gen double BU_Rl = 0;
  8.         gen double BU_Rr = Z1 + C;
  9.         gen double B_Rl = BU_Rl + u_l;
 10.         gen double B_Rr = BU_Rr + u_r;
 11.                 /* Expectation of B */
>         gen double p_r = exp(B_Rr)/(exp(B_Rl)+exp(B_Rr));
 12.         gen double p_l = exp(B_Rl)/(exp(B_Rl)+exp(B_Rr));
 13.                 /* Player A Utilities */
>         gen double AU_L = X1;
 14.         gen double AU_Rl = 0;
 15.         gen double AU_Rr = X2 + C;
 16.         gen double A_L = AU_L + u_L;
 17.         gen double A_R = p_r*AU_Rr + p_l*AU_Rl + u_R;
 18.         gen double p_R = exp(A_R)/(exp(A_L)+exp(A_R));
 19.         gen double p_L = exp(A_L)/(exp(A_L)+exp(A_R));
 20.         /* Outcomes */
>                 /* DV for full strategic logit */
>                 gen     Y3 = . ;
 21.                 replace Y3 = 0 if A_L >= A_R;
 22.                 replace Y3 = 1 if (A_R > A_L) & (B_Rl >= B_Rr);
 23.                 replace Y3 = 2 if (A_R > A_L) & (B_Rr > B_Rl);
 24.                                 /* DV when partially observed */
>                 gen      Y = . ;
 25.                 replace  Y = 0 if (A_L >= A_R) | ((A_R > A_L) & (B_Rl >= B_Rr));
 26.                 replace  Y = 1 if (A_R > A_L) & (B_Rr > B_Rl);
 27.                                 /* Summary of each outcome */
>                 gen out1 = 0;
 28.                 replace out1 = 1 if A_L >= A_R;
 29.                         sum out1;
 30.                         return scalar out1_true=r(mean);
 31.                 gen out2 = 0;
 32.                 replace out2 = 1 if (A_R > A_L) & (B_Rl >= B_Rr);
 33.                         sum out2;
 34.                         return scalar out2_true=r(mean);
 35.                 gen out3 = 0;
 36.                 replace out3 = 1 if (A_R > A_L) & (B_Rr > B_Rl);
 37.                         sum out3;
 38.                         return scalar out3_true=r(mean);
 39.                 #delimit;
delimiter now ;
.         /* Compare estimators */
>                 /* Strategic logit with full information */
>                 ml model lf sl_lf (A_L: Y3 = X1,nocons) (A_Rr:  = X2 C,nocons) (B_Rr:  = Z1 C,nocons) ;
 40.                 ml maximize, diff;
 41.                                 return scalar X1_sl_AL = [A_L]_b[X1];
 42.                         return scalar X1_sl_AL_se = [A_L]_se[X1];
 43.                         return scalar X2_sl_ARr = [A_Rr]_b[X2];
 44.                         return scalar X2_sl_ARr_se = [A_Rr]_se[X2];
 45.                         return scalar C_sl_ARr = [A_Rr]_b[C];
 46.                         return scalar C_sl_ARr_se = [A_Rr]_se[C];
 47.                         return scalar Z1_sl_BRr = [B_Rr]_b[Z1];
 48.                         return scalar Z1_sl_BRr_se = [B_Rr]_se[Z1];
 49.                                 return scalar C_sl_BRr = [B_Rr]_b[C];
 50.                         return scalar C_sl_BRr_se = [B_Rr]_se[C];
 51.                                                         matrix ll_sl = e(ll);
 52.                                                 /* Model fit */
>                                 /* i's likelihood */
>                                 gen double pB_r_sl = (exp( [B_Rr]_b[Z1]*Z1 + [B_Rr]_b[C]*C )) 
>                                                                   /(1+exp( [B_Rr]_b[Z1]*Z1 + [B_Rr]_b[C]*C ));
 53.                                 gen double pA_R_sl =     (exp( pB_r_sl*([A_Rr]_b[X2]*X2 + [A_Rr]_b[C]*C) )) 
>                                 /(exp([A_L]_b[X1]*X1 ) +  exp( pB_r_sl*([A_Rr]_b[X2]*X2 + [A_Rr]_b[C]*C) ));
 54.                                 gen double lnfj_sl = . ;
 55.                                         replace lnfj_sl = ln((1-pA_R_sl)) if Y3==0;
 56.                                         replace lnfj_sl = ln((pA_R_sl)*(1-pB_r_sl)) if Y3==1;
 57.                                         replace lnfj_sl = ln((pA_R_sl)*(pB_r_sl)) if Y3==2;
 58.                                                                 /* pr(outcome) */
>                                 gen double pr_out1_sl = 1-pA_R_sl;
 59.                                 gen double pr_out2_sl = pA_R_sl*(1-pB_r_sl);
 60.                                 gen double pr_out3_sl = pA_R_sl*pB_r_sl;
 61.                                 gen double predict_out1_sl = 0;
 62.                                         replace predict_out1_sl = 1 if pr_out1_sl >= max(pr_out3_sl,pr_out2_sl);
 63.                                         sum predict_out1_sl;
 64.                                         return scalar predict_out1_sl = r(mean);
 65.                                 gen double predict_out2_sl = 0;
 66.                                         replace predict_out2_sl = 1 if pr_out2_sl > max(pr_out1_sl,pr_out3_sl);
 67.                                         sum predict_out2_sl;
 68.                                         return scalar predict_out2_sl = r(mean);
 69.                                                                         gen double predict_out3_sl = 0;
 70.                                         replace predict_out3_sl = 1 if pr_out3_sl > max(pr_out1_sl,pr_out2_sl);
 71.                                         sum predict_out3_sl;
 72.                                         return scalar predict_out3_sl = r(mean);
 73.                                                                         /* observations correctly predicted */
>                                 gen correct_sl = 0;
 74.                                         replace correct_sl = 1 if ( (predict_out1_sl==1 & Y3==0) | (predict_out2_sl==1 & Y3==1) | (pr
> edict_out3_sl==1 & Y3==2) );
 75.                                 sum correct_sl;
 76.                                         return scalar correct_pct_sl = r(mean);
 77.                                 /* Y3s correctly predicted */
>                                 gen correct_out3_sl = . ;
 78.                                         replace correct_out3_sl = 0 if predict_out3_sl==0 & out3==1;
 79.                                         replace correct_out3_sl = 1 if predict_out3_sl==1 & out3==1;
 80.                                 sum correct_out3_sl;
 81.                                         return scalar correct_out3_pct_sl = r(mean);
 82.                                 /* Y3 false positive */
>                                 gen incorrect_out3_sl = . ;
 83.                                         replace incorrect_out3_sl = 0 if predict_out3_sl==0 & out3==0;
 84.                                         replace incorrect_out3_sl = 1 if predict_out3_sl==1 & out3==0;
 85.                                 sum incorrect_out3_sl;
 86.                                         return scalar incorrect_out3_pct_sl = r(mean);
 87.                                 /* Y2s correctly predicted */
>                                 gen correct_out2_sl = . ;
 88.                                         replace correct_out2_sl = 0 if predict_out2_sl==0 & out2==1;
 89.                                         replace correct_out2_sl = 1 if predict_out2_sl==1 & out2==1;
 90.                                 sum correct_out2_sl;
 91.                                         return scalar correct_out2_pct_sl = r(mean);
 92.                                                 #delimit;
delimiter now ;
.                                 /* Strategic logit with partial observability */
>                 ml model lf slpo_lf (A_L: Y = X1,nocons) (A_Rr:  = X2 C,nocons) (B_Rr:  = Z1 C,nocons) ;
 93.                 ml maximize, diff;
 94.                                 return scalar X1_slpo_AL = [A_L]_b[X1];
 95.                         return scalar X1_slpo_AL_se = [A_L]_se[X1];
 96.                         return scalar X2_slpo_ARr = [A_Rr]_b[X2];
 97.                         return scalar X2_slpo_ARr_se = [A_Rr]_se[X2];
 98.                         return scalar C_slpo_ARr = [A_Rr]_b[C];
 99.                         return scalar C_slpo_ARr_se = [A_Rr]_se[C];
100.                         return scalar Z1_slpo_BRr = [B_Rr]_b[Z1];
101.                         return scalar Z1_slpo_BRr_se = [B_Rr]_se[Z1];
102.                                 return scalar C_slpo_BRr = [B_Rr]_b[C];
103.                         return scalar C_slpo_BRr_se = [B_Rr]_se[C];
104.                                                         matrix ll_slpo = e(ll);
105.                                                 /* Model fit */
>                                 /* i's likelihood */
>                                 gen double pB_r_slpo =   (exp( [B_Rr]_b[Z1]*Z1 + [B_Rr]_b[C]*C )) 
>                                                                           /(1+exp( [B_Rr]_b[Z1]*Z1 + [B_Rr]_b[C]*C ));
106.                                 gen double pA_R_slpo =   (exp( pB_r_slpo*([A_Rr]_b[X2]*X2 + [A_Rr]_b[C]*C) ))
>                                   /(exp([A_L]_b[X1]*X1) + exp( pB_r_slpo*([A_Rr]_b[X2]*X2 + [A_Rr]_b[C]*C) ));
107.                                 gen double lnfj_slpo = . ;
108.                                         replace lnfj_slpo = ln((1-pA_R_slpo) + (pA_R_slpo)*(1-pB_r_slpo)) if Y==0;
109.                                         replace lnfj_slpo = ln((pA_R_slpo)*(pB_r_slpo)) if Y==1;
110.                                                                 /* pr(outcome) */
>                                 gen double pr_out1_slpo = 1-pA_R_slpo;
111.                                 gen double pr_out2_slpo = pA_R_slpo*(1-pB_r_slpo);
112.                                 gen double pr_out3_slpo = pA_R_slpo*pB_r_slpo;
113.                                 gen double predict_out1_slpo = 0;
114.                                         replace predict_out1_slpo = 1 if pr_out1_slpo >= max(pr_out3_slpo,pr_out2_slpo);
115.                                         sum predict_out1_slpo;
116.                                         return scalar predict_out1_slpo = r(mean);
117.                                 gen double predict_out2_slpo = 0;
118.                                         replace predict_out2_slpo = 1 if pr_out2_slpo > max(pr_out1_slpo,pr_out3_slpo);
119.                                         sum predict_out2_slpo;
120.                                         return scalar predict_out2_slpo = r(mean);
121.                                 gen double predict_out3_slpo = 0;
122.                                         replace predict_out3_slpo = 1 if pr_out3_slpo > max(pr_out1_slpo,pr_out2_slpo);
123.                                         sum predict_out3_slpo;
124.                                         return scalar predict_out3_slpo = r(mean);
125.                                 /* observations correctly predicted (partial obs 0/1) */
>                                 gen correct_slpo = 0;
126.                                         replace correct_slpo = 1 if ( (predict_out3_slpo==1 & out3==1) | (predict_out3_slpo==0 & out3
> ==0) );
127.                                 sum correct_slpo;
128.                                         return scalar correct_pct_slpo = r(mean);
129.                                                                         /* observations correctly predicted (full info) */
>                                 gen correct_slpo_full = 0;
130.                                         replace correct_slpo_full = 1 if ( (predict_out1_slpo==1 & out1==1) | (predict_out2_slpo==1 &
>  out2==1) | (predict_out3_slpo==1 & out3==1) );
131.                                 sum correct_slpo_full;
132.                                         return scalar correct_pct_slpo_full = r(mean);
133.                                 /* Y3s correctly predicted */
>                                 gen correct_out3_slpo = . ;
134.                                         replace correct_out3_slpo = 0 if predict_out3_slpo==0 & out3==1;
135.                                         replace correct_out3_slpo = 1 if predict_out3_slpo==1 & out3==1;
136.                                 sum correct_out3_slpo;
137.                                         return scalar correct_out3_pct_slpo = r(mean);
138.                                 /* Y3 false positive */
>                                 gen incorrect_out3_slpo = . ;
139.                                         replace incorrect_out3_slpo = 0 if predict_out3_slpo==0 & out3==0;
140.                                         replace incorrect_out3_slpo = 1 if predict_out3_slpo==1 & out3==0;
141.                                 sum incorrect_out3_slpo;
142.                                         return scalar incorrect_out3_pct_slpo = r(mean);
143.                                 /* Y2s correctly predicted */
>                                 gen correct_out2_slpo = . ;
144.                                         replace correct_out2_slpo = 0 if predict_out2_slpo==0 & out2==1;
145.                                         replace correct_out2_slpo = 1 if predict_out2_slpo==1 & out2==1;
146.                                 sum correct_out2_slpo;
147.                                         return scalar correct_out2_pct_slpo = r(mean);
148.                                                                         /* Split-population logit */
>                 gen X1_prime = -X1;
149.                 ml model lf ssl_lf (Rel: Y = X1_prime C,nocons) (Out: Y= X2 Z1 C,nocons);
150.                 ml maximize, diff;
151.                         return scalar X1_ssl_Rel = [Rel]_b[X1_prime];
152.                         return scalar X1_ssl_Rel_se = [Rel]_se[X1_prime];
153.                         return scalar C_ssl_Rel = [Rel]_b[C];
154.                         return scalar C_ssl_Rel_se = [Rel]_se[C];
155.                         return scalar X2_ssl_Out = [Out]_b[X2];
156.                         return scalar X2_ssl_Out_se = [Out]_se[X2];
157.                         return scalar Z1_ssl_Out = [Out]_b[Z1];
158.                         return scalar Z1_ssl_Out_se = [Out]_se[Z1];
159.                         return scalar C_ssl_Out = [Out]_b[C];
160.                         return scalar C_ssl_Out_se = [Out]_se[C];
161.                         matrix ll_ssl = e(ll);
162.                                                 /* Model fit */
>                                 /* i's likelihood */
>                                 quietly gen double rel_ssl =    exp([Rel]_b[X1_prime]*X1_prime + [Rel]_b[C]*C )
>                                                                                         /(1+exp([Rel]_b[X1_prime]*X1_prime + [Rel]_b[C]*
> C ));
163.                                 quietly gen double out_ssl =    exp([Out]_b[X2]*X2 + [Out]_b[Z1]*Z1 + [Out]_b[C]*C )
>                                                                                         /(1+exp([Out]_b[X2]*X2 + [Out]_b[Z1]*Z1 + [Out]_
> b[C]*C ));
164.                                 gen double lnfj_ssl = . ;
165.                                         replace lnfj_ssl = ln((1-rel_ssl) + (rel_ssl)*(1-out_ssl)) if Y==0;
166.                                         replace lnfj_ssl = ln((rel_ssl)*(out_ssl)) if Y==1;
167.                                         /* pr(outcome) */
>                                 gen double pr_out1_ssl = 1-rel_ssl;
168.                                 gen double pr_out2_ssl = rel_ssl*(1-out_ssl);
169.                                 gen double pr_out3_ssl = rel_ssl*out_ssl;
170.                                 gen double predict_out1_ssl = 0;
171.                                         replace predict_out1_ssl = 1 if pr_out1_ssl >= max(pr_out3_ssl,pr_out2_ssl);
172.                                         sum predict_out1_ssl;
173.                                         return scalar predict_out1_ssl = r(mean);
174.                                 gen double predict_out2_ssl = 0;
175.                                         replace predict_out2_ssl = 1 if pr_out2_ssl > max(pr_out1_ssl,pr_out3_ssl);
176.                                         sum predict_out2_ssl;
177.                                         return scalar predict_out2_ssl = r(mean);
178.                                 gen double predict_out3_ssl = 0;
179.                                         replace predict_out3_ssl = 1 if pr_out3_ssl > max(pr_out1_ssl,pr_out2_ssl);
180.                                         sum predict_out3_ssl;
181.                                         return scalar predict_out3_ssl = r(mean);
182.                                 /* observations correctly predicted (partial obs 0/1) */
>                                 gen correct_ssl = 0;
183.                                         replace correct_ssl = 1 if ( (predict_out3_ssl==1 & out3==1) | (predict_out3_ssl==0 & out3==0
> ) );
184.                                 sum correct_ssl;
185.                                         return scalar correct_pct_ssl = r(mean);
186.                                                                 /* observations correctly predicted (full info) */
>                                 gen correct_ssl_full = 0;
187.                                         replace correct_ssl_full = 1 if ( (predict_out1_ssl==1 & out1==1) | (predict_out2_ssl==1 & ou
> t2==1) | (predict_out3_ssl==1 & out3==1) );
188.                                 sum correct_ssl_full;
189.                                         return scalar correct_pct_ssl_full = r(mean);
190.                                 /* Y3s correctly predicted */
>                                 gen correct_out3_ssl = . ;
191.                                         replace correct_out3_ssl = 0 if predict_out3_ssl==0 & out3==1;
192.                                         replace correct_out3_ssl = 1 if predict_out3_ssl==1 & out3==1;
193.                                 sum correct_out3_ssl;
194.                                         return scalar correct_out3_pct_ssl = r(mean);
195.                                 /* Y3 false positive */
>                                 gen incorrect_out3_ssl = . ;
196.                                         replace incorrect_out3_ssl = 0 if predict_out3_ssl==0 & out3==0;
197.                                         replace incorrect_out3_ssl = 1 if predict_out3_ssl==1 & out3==0;
198.                                 sum incorrect_out3_ssl;
199.                                         return scalar incorrect_out3_pct_ssl = r(mean);
200.                                 /* Y2s correctly predicted */
>                                 gen correct_out2_ssl = . ;
201.                                         replace correct_out2_ssl = 0 if predict_out2_slpo==0 & out2==1;
202.                                         replace correct_out2_ssl = 1 if predict_out2_slpo==1 & out2==1;
203.                                 sum correct_out2_ssl;
204.                                         return scalar correct_out2_pct_ssl = r(mean);
205.                                                                                                                         /* Traditiona
> l logit */
>                 logit Y X1_prime X2 Z1 C,nocons;
206.                         return scalar X1_l = _b[X1_prime];
207.                         return scalar X1_l_se = _se[X1_prime];
208.                         return scalar X2_l = _b[X2];
209.                         return scalar X2_l_se = _se[X2];
210.                         return scalar Z1_l = _b[Z1];
211.                         return scalar Z1_l_se = _se[Z1];
212.                         return scalar C_l = _b[C];
213.                         return scalar C_l_se = _se[C];
214.                         matrix ll_l = e(ll);
215.                                                 /* Model fit */
>                                 /* i's likelihood */
>                                 gen double lnfj_l = . ;
216.                                 replace lnfj_l = ln(invlogit(-(_b[X1_prime]*X1_prime + _b[X2]*X2 + _b[Z1]*Z1 + _b[C]*C ))) if Y==0;
217.                                 replace lnfj_l = ln(invlogit(  _b[X1_prime]*X1_prime + _b[X2]*X2 + _b[Z1]*Z1 + _b[C]*C  )) if Y==1;
218.                                                                 /* pr(outcome) */
>                                 gen double pr_out3_l = invlogit(_b[X1]*X1 + _b[X2]*X2 + _b[Z1]*Z1 + _b[C]*C );
219.                                 gen double predict_out3_l = 0;
220.                                         replace predict_out3_l = 1 if pr_out3_l >= .5;
221.                                 sum predict_out3_l;
222.                                         return scalar predict_out3_l = r(mean);
223.                                 /* observations correctly predicted (partial obs 0/1) */
>                                 gen correct_l = 0;
224.                                         replace correct_l = 1 if ( (predict_out3_l==1 & out3==1) | (predict_out3_l==0 & out3==0) );
225.                                 sum correct_l;
226.                                         return scalar correct_pct_l = r(mean);
227.                                 /* Y3s correctly predicted */
>                                 gen correct_out3_l = . ;
228.                                         replace correct_out3_l = 0 if predict_out3_l==0 & out3==1;
229.                                         replace correct_out3_l = 1 if predict_out3_l==1 & out3==1;
230.                                 sum correct_out3_l;
231.                                         return scalar correct_out3_pct_l = r(mean);
232.                                 /* Y3 false positive */
>                                 gen incorrect_out3_l = . ;
233.                                         replace incorrect_out3_l = 0 if predict_out3_l==0 & out3==0;
234.                                         replace incorrect_out3_l = 1 if predict_out3_l==1 & out3==0;
235.                                 sum incorrect_out3_l;
236.                                         return scalar incorrect_out3_pct_l = r(mean);
237.                 /* Use Clarke's non-parametric approach to compare each observation's likelihood: slpo vs sl*/
>                 signtest lnfj_slpo=lnfj_sl;
238.                 return scalar Clark_slpo_sl_pos = r(N_pos);
239.                 return scalar Clark_slpo_sl_neg = r(N_neg);
240.                 return scalar Clark_slpo_sl_tie = r(N_tie);
241.                 return scalar Clark_slpo_sl_pos_1s = r(p_pos);
242.                 return scalar Clark_slpo_sl_neg_1s = r(p_neg);
243.                 return scalar Clark_slpo_sl_eq_2s = r(p_2);
244.                                 /* Use Clarke's non-parametric approach to compare each observation's likelihood: slpo vs ssl*/
>                 signtest lnfj_slpo=lnfj_ssl;
245.                 return scalar Clark_slpo_ssl_pos = r(N_pos);
246.                 return scalar Clark_slpo_ssl_neg = r(N_neg);
247.                 return scalar Clark_slpo_ssl_tie = r(N_tie);
248.                                 return scalar Clark_slpo_ssl_pos_1s = r(p_pos);
249.                 return scalar Clark_slpo_ssl_neg_1s = r(p_neg);
250.                 return scalar Clark_slpo_ssl_eq_2s = r(p_2);
251.                 /* Use Clark's non-parametric approach to compare each observation's likelihood: slpo vs logit*/
>                 signtest lnfj_slpo=lnfj_l;
252.                 return scalar Clark_slpo_l_pos = r(N_pos);
253.                 return scalar Clark_slpo_l_neg = r(N_neg);
254.                 return scalar Clark_slpo_l_tie = r(N_tie);
255.                                 return scalar Clark_slpo_l_pos_1s = r(p_pos);
256.                 return scalar Clark_slpo_l_neg_1s = r(p_neg);
257.                 return scalar Clark_slpo_l_eq_2s = r(p_2);
258.                                                                         /* Vuong Test: slpo vs sl*/
>                 svmat ll_sl;
259.                 svmat ll_slpo;
260.                 gen num_V_slpo_sl = ll_slpo1 - ll_sl1 + ((5/2)*ln(_N)-(5/2)*ln(_N));
261.                 sum num_V_slpo_sl;
262.                         return scalar num_V_slpo_sl = r(mean);
263.                 egen denom1_V_1_slpo_sl = mean((lnfj_slpo/lnfj_sl)^2);
264.                 egen denom1_V_2_slpo_sl = mean(lnfj_slpo/lnfj_sl);
265.                 gen denom1_V_3_slpo_sl = denom1_V_2_slpo_sl^2;
266.                 gen denom2_V_slpo_sl = sqrt(denom1_V_1_slpo_sl - denom1_V_3_slpo_sl);
267.                 sum denom2_V_slpo_sl;
268.                         return scalar denom2_V_slpo_sl = r(mean);
269.                 gen Vuong_slpo_sl = num_V_slpo_sl/denom2_V_slpo_sl;
270.                 sum Vuong_slpo_sl;
271.                         return scalar Vuong_slpo_sl = r(mean);
272.                 /* Vuong Test: slpo vs ssl*/
>                 svmat ll_ssl;
273.                 gen num_V_slpo_ssl = ll_slpo1 - ll_ssl1 + ((5/2)*ln(_N)-(5/2)*ln(_N));
274.                 sum num_V_slpo_ssl;
275.                         return scalar num_V_slpo_ssl = r(mean);
276.                 egen denom1_V_1_slpo_ssl = mean((lnfj_slpo/lnfj_ssl)^2);
277.                 egen denom1_V_2_slpo_ssl = mean(lnfj_slpo/lnfj_ssl);
278.                 gen denom1_V_3_slpo_ssl = denom1_V_2_slpo_ssl^2;
279.                 gen denom2_V_slpo_ssl = sqrt(denom1_V_1_slpo_ssl - denom1_V_3_slpo_ssl);
280.                 sum denom2_V_slpo_ssl;
281.                         return scalar denom2_V_slpo_ssl = r(mean);
282.                 gen Vuong_slpo_ssl = num_V_slpo_ssl/denom2_V_slpo_ssl;
283.                 sum Vuong_slpo_ssl;
284.                         return scalar Vuong_slpo_ssl = r(mean);
285.                                         /* Vuong Test: slpo vs l*/
>                 svmat ll_l;
286.                 gen num_V_slpo_l = ll_slpo1 - ll_l1 + ((5/2)*ln(_N)-(4/2)*ln(_N));
287.                 sum num_V_slpo_l;
288.                         return scalar num_V_slpo_l=r(mean);
289.                 egen denom1_V_1_slpo_l = mean((lnfj_slpo/lnfj_l)^2);
290.                 egen denom1_V_2_slpo_l = mean(lnfj_slpo/lnfj_l);
291.                 gen denom1_V_3_slpo_l = denom1_V_2_slpo_l^2;
292.                 gen denom2_V_slpo_l = sqrt(denom1_V_1_slpo_l - denom1_V_3_slpo_l);
293.                 sum denom2_V_slpo_l;
294.                         return scalar denom2_V_slpo_l = r(mean);
295.                 gen Vuong_slpo_l = num_V_slpo_l/denom2_V_slpo_l;
296.                 sum Vuong_slpo_l;
297.                         return scalar Vuong_slpo_l = r(mean);
298.                                         end;

.                         #delimit;
delimiter now ;
. /* Generate Independent Variables */
>         set obs 2000;
number of observations (_N) was 0, now 2,000

.         /* Generate Covariates U[-4, 4] */
>         gen double X1 = runiform()*8 - 4;

.         gen double X2 = runiform()*8 - 4;

.         gen double X3 = runiform()*8 - 4;

.         gen double Z1 = runiform()*8 - 4;

.         gen double C  = runiform()*8 - 4;

.                 save indvars.dta, replace;
(note: file indvars.dta not found)
file indvars.dta saved

.                 /* Run simulations */   
>         simulate
>                 X1_sl_AL=r(X1_sl_AL) X1_sl_AL_se=r(X1_sl_AL_se)
>                 X2_sl_ARr=r(X2_sl_ARr) X2_sl_ARr_se=r(X2_sl_ARr_se)
>                 C_sl_ARr=r(C_sl_ARr) C_sl_ARr_se=r(C_sl_ARr_se)
>                 Z1_sl_BRr=r(Z1_sl_BRr) Z1_sl_BRr_se=r(Z1_sl_BRr_se)
>                 C_sl_BRr=r(C_sl_BRr) C_sl_BRr_se=r(C_sl_BRr_se)
>                 
>                 X1_slpo_AL=r(X1_slpo_AL) X1_slpo_AL_se=r(X1_slpo_AL_se)
>                 X2_slpo_ARr=r(X2_slpo_ARr) X2_slpo_ARr_se=r(X2_slpo_ARr_se)
>                 C_slpo_ARr=r(C_slpo_ARr) C_slpo_ARr_se=r(C_slpo_ARr_se)
>                 Z1_slpo_BRr=r(Z1_slpo_BRr) Z1_slpo_BRr_se=r(Z1_slpo_BRr_se)
>                 C_slpo_BRr=r(C_slpo_BRr) C_slpo_BRr_se=r(C_slpo_BRr_se)
>                 
>                 X1_ssl_Rel=r(X1_ssl_Rel) X1_ssl_Rel_se=r(X1_ssl_Rel_se)
>                 C_ssl_Rel=r(C_ssl_Rel) C_ssl_Rel_se=r(C_ssl_Rel_se)
>                 X2_ssl_Out=r(X2_ssl_Out) X2_ssl_Out_se=r(X2_ssl_Out_se)
>                 Z1_ssl_Out=r(Z1_ssl_Out) Z1_ssl_Out_se=r(Z1_ssl_Out_se)
>                 C_ssl_Out=r(C_ssl_Out) C_ssl_Out_se=r(C_ssl_Out_se)
>                 
>                 X1_l=r(X1_l) X1_l_se=r(X1_l_se)
>                 X2_l=r(X2_l) X2_l_se=r(X2_l_se)
>                 Z1_l=r(Z1_l) Z1_l_se=r(Z1_l_se)
>                 C_l=r(C_l) C_l_se=r(C_l_se)
>                 
>                 out1_true=r(out1_true)
>                 out2_true=r(out2_true)
>                 out3_true=r(out3_true)
>                 
>                 predict_out1_sl = r(predict_out1_sl)
>                 predict_out2_sl = r(predict_out2_sl)
>                 predict_out3_sl = r(predict_out3_sl)
>                 predict_out1_slpo = r(predict_out1_slpo)
>                 predict_out2_slpo = r(predict_out2_slpo)
>                 predict_out3_slpo = r(predict_out3_slpo)
>                 predict_out1_ssl = r(predict_out1_ssl)
>                 predict_out2_ssl = r(predict_out2_ssl)
>                 predict_out3_ssl = r(predict_out3_ssl)  
>                 predict_out3_l = r(predict_out3_l)              
>                 
>                 correct_pct_sl=r(correct_pct_sl) 
>                 correct_out3_pct_sl=r(correct_out3_pct_sl)
>                 incorrect_out3_pct_sl=r(incorrect_out3_pct_sl)
>                 correct_out2_pct_sl=r(correct_out2_pct_sl)
>                 
>                 correct_pct_slpo=r(correct_pct_slpo)
>                 correct_pct_slpo_full=r(correct_pct_slpo_full)
>                 correct_out3_pct_slpo=r(correct_out3_pct_slpo)
>                 incorrect_out3_pct_slpo=r(incorrect_out3_pct_slpo)
>                 correct_out2_pct_slpo=r(correct_out2_pct_slpo)
>                 
>                 correct_pct_ssl=r(correct_pct_ssl)
>                 correct_pct_ssl_full=r(correct_pct_ssl_full)
>                 correct_out3_pct_ssl=r(correct_out3_pct_ssl)
>                 incorrect_out3_pct_ssl=r(incorrect_out3_pct_ssl)
>                 correct_out2_pct_ssl=r(correct_out2_pct_ssl)
>                 
>                 correct_pct_l=r(correct_pct_l)
>                 correct_out3_pct_l=r(correct_out3_pct_l)
>                 incorrect_out3_pct_l=r(incorrect_out3_pct_l)
>                 
>                 Clark_slpo_sl_pos=r(Clark_slpo_sl_pos)
>                 Clark_slpo_sl_pos_1s=r(Clark_slpo_sl_pos_1s)
>                 Clark_slpo_sl_neg_1s=r(Clark_slpo_sl_neg_1s)
>                 Clark_slpo_sl_eq_2s=r(Clark_slpo_sl_eq_2s)
>                 
>                 Clark_slpo_ssl_pos=r(Clark_slpo_ssl_pos)
>                 Clark_slpo_ssl_pos_1s=r(Clark_slpo_ssl_pos_1s)
>                 Clark_slpo_ssl_neg_1s=r(Clark_slpo_ssl_neg_1s)
>                 Clark_slpo_ssl_eq_2s=r(Clark_slpo_ssl_eq_2s)
>                 
>                 Clark_slpo_l_pos=r(Clark_slpo_l_pos)
>                 Clark_slpo_l_pos_1s=r(Clark_slpo_l_pos_1s)
>                 Clark_slpo_l_neg_1s=r(Clark_slpo_l_neg_1s)
>                 Clark_slpo_l_eq_2s=r(Clark_slpo_l_eq_2s)
>                 
>                 num_V_slpo_sl=r(num_V_slpo_sl)
>                 denom2_V_slpo_sl=r(denom2_V_slpo_sl)
>                 Vuong_slpo_sl=r(Vuong_slpo_sl)
>                 
>                 num_V_slpo_ssl=r(num_V_slpo_ssl)
>                 denom2_V_slpo_ssl=r(denom2_V_slpo_ssl)
>                 Vuong_slpo_ssl=r(Vuong_slpo_ssl)
>                 
>                 num_V_slpo_l=r(num_V_slpo_l)
>                 denom2_V_slpo_l=r(denom2_V_slpo_l)
>                 Vuong_slpo_l=r(Vuong_slpo_l)            
>         ,
>         
>         reps(1000): 
>         mc_strat, indvars(indvars) ;

         command:  mc_strat, indvars(indvars)
        X1_sl_AL:  r(X1_sl_AL)
     X1_sl_AL_se:  r(X1_sl_AL_se)
       X2_sl_ARr:  r(X2_sl_ARr)
    X2_sl_ARr_se:  r(X2_sl_ARr_se)
        C_sl_ARr:  r(C_sl_ARr)
     C_sl_ARr_se:  r(C_sl_ARr_se)
       Z1_sl_BRr:  r(Z1_sl_BRr)
    Z1_sl_BRr_se:  r(Z1_sl_BRr_se)
        C_sl_BRr:  r(C_sl_BRr)
     C_sl_BRr_se:  r(C_sl_BRr_se)
      X1_slpo_AL:  r(X1_slpo_AL)
   X1_slpo_AL_se:  r(X1_slpo_AL_se)
     X2_slpo_ARr:  r(X2_slpo_ARr)
  X2_slpo_ARr_se:  r(X2_slpo_ARr_se)
      C_slpo_ARr:  r(C_slpo_ARr)
   C_slpo_ARr_se:  r(C_slpo_ARr_se)
     Z1_slpo_BRr:  r(Z1_slpo_BRr)
  Z1_slpo_BRr_se:  r(Z1_slpo_BRr_se)
      C_slpo_BRr:  r(C_slpo_BRr)
   C_slpo_BRr_se:  r(C_slpo_BRr_se)
      X1_ssl_Rel:  r(X1_ssl_Rel)
   X1_ssl_Rel_se:  r(X1_ssl_Rel_se)
       C_ssl_Rel:  r(C_ssl_Rel)
    C_ssl_Rel_se:  r(C_ssl_Rel_se)
      X2_ssl_Out:  r(X2_ssl_Out)
   X2_ssl_Out_se:  r(X2_ssl_Out_se)
      Z1_ssl_Out:  r(Z1_ssl_Out)
   Z1_ssl_Out_se:  r(Z1_ssl_Out_se)
       C_ssl_Out:  r(C_ssl_Out)
    C_ssl_Out_se:  r(C_ssl_Out_se)
            X1_l:  r(X1_l)
         X1_l_se:  r(X1_l_se)
            X2_l:  r(X2_l)
         X2_l_se:  r(X2_l_se)
            Z1_l:  r(Z1_l)
         Z1_l_se:  r(Z1_l_se)
             C_l:  r(C_l)
          C_l_se:  r(C_l_se)
       out1_true:  r(out1_true)
       out2_true:  r(out2_true)
       out3_true:  r(out3_true)
 predict_out1_sl:  r(predict_out1_sl)
 predict_out2_sl:  r(predict_out2_sl)
 predict_out3_sl:  r(predict_out3_sl)
predict_out1_s~o:  r(predict_out1_slpo)
predict_out2_s~o:  r(predict_out2_slpo)
predict_out3_s~o:  r(predict_out3_slpo)
predict_out1_ssl:  r(predict_out1_ssl)
predict_out2_ssl:  r(predict_out2_ssl)
predict_out3_ssl:  r(predict_out3_ssl)
  predict_out3_l:  r(predict_out3_l)
  correct_pct_sl:  r(correct_pct_sl)
correct_out3_p~l:  r(correct_out3_pct_sl)
incorrect_ou~_sl:  r(incorrect_out3_pct_sl)
correct_out2_p~l:  r(correct_out2_pct_sl)
correct_pct_slpo:  r(correct_pct_slpo)
correct_pct_sl~l:  r(correct_pct_slpo_full)
correct_out3_p~o:  r(correct_out3_pct_slpo)
incorrect_out3~o:  r(incorrect_out3_pct_slpo)
correct_out2_p~o:  r(correct_out2_pct_slpo)
 correct_pct_ssl:  r(correct_pct_ssl)
correct_pct_ss~l:  r(correct_pct_ssl_full)
correct_out3_p~l:  r(correct_out3_pct_ssl)
incorrect_ou~ssl:  r(incorrect_out3_pct_ssl)
correct_out2_p~l:  r(correct_out2_pct_ssl)
   correct_pct_l:  r(correct_pct_l)
correct_out3_p~l:  r(correct_out3_pct_l)
incorrect_out~_l:  r(incorrect_out3_pct_l)
Clark_slpo_sl_~s:  r(Clark_slpo_sl_pos)
Clark_slpo_sl~1s:  r(Clark_slpo_sl_pos_1s)
Clark_slpo_sl~1s:  r(Clark_slpo_sl_neg_1s)
Clark_slpo_sl~2s:  r(Clark_slpo_sl_eq_2s)
Clark_slpo_ssl~s:  r(Clark_slpo_ssl_pos)
Clark_slpo_ss~1s:  r(Clark_slpo_ssl_pos_1s)
Clark_slpo_ss~1s:  r(Clark_slpo_ssl_neg_1s)
Clark_slpo_ss~2s:  r(Clark_slpo_ssl_eq_2s)
Clark_slpo_l_pos:  r(Clark_slpo_l_pos)
Clark_slpo_l_~1s:  r(Clark_slpo_l_pos_1s)
Clark_slpo_l_~1s:  r(Clark_slpo_l_neg_1s)
Clark_slpo_l_~2s:  r(Clark_slpo_l_eq_2s)
   num_V_slpo_sl:  r(num_V_slpo_sl)
denom2_V_slpo_sl:  r(denom2_V_slpo_sl)
   Vuong_slpo_sl:  r(Vuong_slpo_sl)
  num_V_slpo_ssl:  r(num_V_slpo_ssl)
denom2_V_slp~ssl:  r(denom2_V_slpo_ssl)
  Vuong_slpo_ssl:  r(Vuong_slpo_ssl)
    num_V_slpo_l:  r(num_V_slpo_l)
 denom2_V_slpo_l:  r(denom2_V_slpo_l)
    Vuong_slpo_l:  r(Vuong_slpo_l)

Simulations (1000)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200
..................................................   250
..................................................   300
..................................................   350
..................................................   400
..................................................   450
..................................................   500
..................................................   550
..................................................   600
..................................................   650
..................................................   700
..................................................   750
..................................................   800
..................................................   850
..................................................   900
..................................................   950
..................................................  1000

.                 save mc_ss_results, replace;
(note: file mc_ss_results.dta not found)
file mc_ss_results.dta saved

.         /* View Results */
> sum;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    X1_sl_AL |      1,000    .9417634     .042688   .8296457   1.067666
 X1_sl_AL_se |      1,000    .0425211    .0018806   .0376771   .0488012
   X2_sl_ARr |      1,000    .8853754     .061755   .7123637    1.08651
X2_sl_ARr_se |      1,000    .0612361    .0024638   .0548507   .0696419
    C_sl_ARr |      1,000    .8821435    .0598149   .6935812   1.081731
-------------+---------------------------------------------------------
 C_sl_ARr_se |      1,000    .0616813    .0024786   .0553155   .0700824
   Z1_sl_BRr |      1,000    .9841041    .0639496   .7978325   1.213106
Z1_sl_BRr_se |      1,000     .064188    .0044251   .0521802   .0806484
    C_sl_BRr |      1,000    1.040979    .0660269   .8285612   1.250466
 C_sl_BRr_se |      1,000    .0645459    .0047503   .0513629   .0821384
-------------+---------------------------------------------------------
  X1_slpo_AL |      1,000    .9662603    .0874632    .754514   1.254359
X1_slpo_AL~e |      1,000    .0845867    .0091389   .0642917   .1173235
 X2_slpo_ARr |      1,000     1.00183    .1037059   .7410219   1.445925
X2_slpo_AR~e |      1,000    .0987373    .0115412   .0737486   .1441566
  C_slpo_ARr |      1,000    .9758494     .107535   .6713469   1.370826
-------------+---------------------------------------------------------
C_slpo_ARr~e |      1,000    .1047143     .012681   .0724144   .1685293
 Z1_slpo_BRr |      1,000     .999062    .0814045   .6847403   1.342013
Z1_slpo_BR~e |      1,000    .0791686    .0076734   .0527977   .1157711
  C_slpo_BRr |      1,000    1.053644    .0863697   .7143115    1.34841
C_slpo_BRr~e |      1,000    .0831895    .0082608   .0587787   .1177839
-------------+---------------------------------------------------------
  X1_ssl_Rel |      1,000    .6793351    .0490411   .5395879   .8431066
X1_ssl_Rel~e |      1,000    .0553223    .0039731   .0463161   .0784696
   C_ssl_Rel |      1,000    .5588561    .0500337   .4391742   .7483533
C_ssl_Rel_se |      1,000    .0592106    .0055663    .046438   .0987988
  X2_ssl_Out |      1,000    .3525333    .0539751   .1722596   .5365388
-------------+---------------------------------------------------------
X2_ssl_Out~e |      1,000    .0536182    .0030503   .0441663   .0707688
  Z1_ssl_Out |      1,000    .9755104    .0947714   .6388807    1.30187
Z1_ssl_Out~e |      1,000    .0937908    .0101315   .0606137   .1344601
   C_ssl_Out |      1,000    .9628278    .1015972   .6262243   1.277262
C_ssl_Out_se |      1,000    .1022605    .0108789   .0731343   .1505983
-------------+---------------------------------------------------------
        X1_l |      1,000    .3286418    .0214856   .2611734   .3999811
     X1_l_se |      1,000    .0263692    .0004802   .0249868   .0281318
        X2_l |      1,000    .2753654    .0194974   .2054594   .3521346
     X2_l_se |      1,000    .0256669    .0004079   .0244959   .0275955
        Z1_l |      1,000    .3444426    .0202726   .2753505   .4028292
-------------+---------------------------------------------------------
     Z1_l_se |      1,000    .0268498    .0004646    .025356    .028431
         C_l |      1,000     .577849    .0229685   .5064283   .6514872
      C_l_se |      1,000    .0296221     .000692   .0275218   .0320172
   out1_true |      1,000    .4470895    .0073649       .423       .474
   out2_true |      1,000    .2452235    .0071808      .2255      .2695
-------------+---------------------------------------------------------
   out3_true |      1,000     .307687    .0067524       .287      .3285
predict~1_sl |      1,000     .458218     .004649      .4455      .4745
predict~2_sl |      1,000     .234306    .0018278       .227       .241
predict~3_sl |      1,000     .307476    .0044201      .2915      .3185
predi~1_slpo |      1,000     .455366    .0051136      .4395      .4715
-------------+---------------------------------------------------------
predi~2_slpo |      1,000    .2343215    .0023829      .2235      .2405
predi~3_slpo |      1,000    .3103125    .0047845       .295       .323
predic~1_ssl |      1,000    .5212995    .0040273       .509      .5355
predic~2_ssl |      1,000      .16054    .0065925      .1385       .182
predic~3_ssl |      1,000    .3181605    .0047889       .304       .332
-------------+---------------------------------------------------------
predict_o~_l |      1,000    .5054215    .0030055       .495       .513
cor~t_pct_sl |      1,000     .784952    .0083611        .76       .808
cor~3_pct_sl |      1,000     .793351    .0140501   .7409163   .8339041
incorrec~_sl |      1,000    .0915544     .005733   .0740741   .1095204
cor~2_pct_sl |      1,000    .6794642    .0173652   .6128405   .7280514
-------------+---------------------------------------------------------
correct_pc~o |      1,000    .8734185    .0066068      .8535       .895
corre~o_full |      1,000    .7849315    .0082888        .76      .8075
c~3_pct_slpo |      1,000    .7986484     .013817   .7409163   .8349673
incorrect_~o |      1,000     .093297    .0056527   .0777696   .1095204
c~2_pct_slpo |      1,000    .6792122    .0174013   .6167315   .7354839
-------------+---------------------------------------------------------
co~t_pct_ssl |      1,000    .8384485    .0066826       .815        .86
corre~l_full |      1,000     .707672    .0113371       .668       .743
co~3_pct_ssl |      1,000    .7545661    .0136115    .710443   .7953795
incorrec~ssl |      1,000    .1242168    .0061992   .1046512   .1428571
co~2_pct_ssl |      1,000    .6792122    .0174013   .6167315   .7354839
-------------+---------------------------------------------------------
correct_p~_l |      1,000    .6744445    .0110627      .6405       .706
correct_o~_l |      1,000    .7923916     .021847   .7252396   .8535774
incorrect~_l |      1,000    .3779097    .0070649   .3556851   .3994294
Clar~_sl_pos |      1,000     1738.35    100.8835       1414       1916
C~_sl_pos_1s |      1,000           0           0          0          0
-------------+---------------------------------------------------------
C~_sl_neg_1s |      1,000           1           0          1          1
Cl~_sl_eq_2s |      1,000           0           0          0          0
Clar~ssl_pos |      1,000    1191.254    51.99826       1041       1368
C~ssl_pos_1s |      1,000     .000117    .0013988          0   .0350405
C~ssl_neg_1s |      1,000    .9998959    .0012568   .9682822          1
-------------+---------------------------------------------------------
Cl~ssl_eq_2s |      1,000    .0002339    .0027976          0   .0700809
Clark~_l_pos |      1,000    1622.903    25.17012       1533       1695
Cl~_l_pos_1s |      1,000           0           0          0          0
Cl~_l_neg_1s |      1,000           1           0          1          1
Cla~_l_eq_2s |      1,000           0           0          0          0
-------------+---------------------------------------------------------
num_V_sl~_sl |      1,000     464.078    20.61535   394.8464   526.7889
denom2_V~_sl |      1,000    .3949864    .0201408   .3535647   .5174612
Vuong_sl~_sl |      1,000     1178.86    91.90685   891.9377   1444.766
num_V_sl~ssl |      1,000    94.59452    12.84268   56.45276    139.204
denom2_V~ssl |      1,000    1.385226    .3844115   .8029917   4.042816
-------------+---------------------------------------------------------
Vuong_sl~ssl |      1,000    73.46007    22.26249   17.28959   145.0206
num_V_slpo_l |      1,000    374.0073    21.12856   304.2753   430.8853
denom2_V_~_l |      1,000    1.119744    .0857202   .8869852   1.561001
Vuong_slpo_l |      1,000    336.4805    36.94346     219.95   466.5074

.          /*generate root mean standard error for each parameter */
>         #delimit;
delimiter now ;
.         gen rmse_X1_sl_AL = sqrt((X1_sl_AL - 1)^2 + (X1_sl_AL_se));

.         gen rmse_X1_slpo_AL = sqrt((X1_slpo_AL - 1)^2 + (X1_slpo_AL_se));

.         gen rmse_X1_ssl_Rel = sqrt((X1_ssl_Rel - 1)^2 + (X1_ssl_Rel_se));

.         gen rmse_X1_l = sqrt((X1_l - 1)^2 + (X1_l_se));

.                         gen rmse_X2_sl_ARr = sqrt((X2_sl_ARr - 1)^2 + (X2_sl_ARr_se));

.         gen rmse_X2_slpo_ARr = sqrt((X2_slpo_ARr - 1)^2 + (X2_slpo_ARr_se));

.         gen rmse_X2_ssl_Out = sqrt((X2_ssl_Out - 1)^2 + (X2_ssl_Out_se));

.         gen rmse_X2_l = sqrt((X2_l - 1)^2 + (X2_l_se));

.         gen rmse_C_sl_ARr = sqrt((C_sl_ARr - 1)^2 + (C_sl_ARr_se));

.         gen rmse_C_slpo_ARr = sqrt((C_slpo_ARr - 1)^2 + (C_slpo_ARr_se));

.         gen rmse_C_ssl_Rel = sqrt((C_ssl_Rel - 1)^2 + (C_ssl_Rel_se));

.         gen rmse_Z1_sl_BRr = sqrt((Z1_sl_BRr - 1)^2 + (Z1_sl_BRr_se));

.         gen rmse_Z1_slpo_BRr = sqrt((Z1_slpo_BRr - 1)^2 + (Z1_slpo_BRr_se));

.         gen rmse_Z1_ssl_Out = sqrt((Z1_ssl_Out - 1)^2 + (Z1_ssl_Out_se));

.         gen rmse_Z1_l = sqrt((Z1_l - 1)^2 + (Z1_l_se));

.         gen rmse_C_sl_BRr = sqrt((C_sl_BRr - 1)^2 + (C_sl_BRr_se));

.         gen rmse_C_slpo_BRr = sqrt((C_slpo_BRr - 1)^2 + (C_slpo_BRr_se));

.         gen rmse_C_ssl_Out = sqrt((C_ssl_Out - 1)^2 + (C_ssl_Out_se));

.         gen rmse_C_l = sqrt((C_l - 1)^2 + (C_l_se));

. sum rmse*;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
rmse_X1~l_AL |      1,000    .2183199    .0083394   .2094346   .2586092
rmse_X1~o_AL |      1,000    .3049489    .0193334   .2774222   .4230707
rmse_X1_ss~l |      1,000    .3991484    .0351085   .3015249   .5105661
   rmse_X1_l |      1,000    .6907455    .0205758   .6227504   .7558464
rmse_X~l_ARr |      1,000    .2787595     .021873   .2515412   .3712818
-------------+---------------------------------------------------------
rmse_X~o_ARr |      1,000    .3295208    .0300283   .2896346   .5847481
rmse_X2_ss~t |      1,000    .6879712    .0493945   .5264313   .8566585
   rmse_X2_l |      1,000    .7421509    .0188209   .6688237   .8100727
rmse_C~l_ARr |      1,000    .2805193    .0213324   .2526818   .3864047
rmse_C~o_ARr |      1,000    .3407619     .027052   .2995533   .5532101
-------------+---------------------------------------------------------
rmse_C_ssl~l |      1,000    .5047492    .0393593   .3699175   .6070997
rmse_Z~l_BRr |      1,000    .2614684    .0126706   .2459642   .3535478
rmse_Z~o_BRr |      1,000    .2920463    .0223387   .2640262   .4824357
rmse_Z1_ss~t |      1,000    .3206962    .0227518   .2888383   .4718424
   rmse_Z1_l |      1,000    .6757521    .0193735   .6203816   .7420946
-------------+---------------------------------------------------------
rmse_C~l_BRr |      1,000    .2647293    .0223438   .2387751   .3772405
rmse_C~o_BRr |      1,000    .3041056    .0322522   .2624663   .4824531
rmse_C_ssl~t |      1,000    .3367259    .0238789    .298609   .4613487
    rmse_C_l |      1,000     .456004    .0205274   .3916164   .5209798

.         /* graph the betas */
> #delimit;
delimiter now ;
. twoway kdensity X1_sl_AL, scheme(s1color) color(black) lwidth(thin) lpattern(solid)
>         || kdensity X1_slpo_AL, color(black) lwidth(thick) lpattern(solid)
>         || kdensity X1_ssl_Rel, color(gs5) lwidth(medium) lpattern(dash)
>         || kdensity X1_l, color(gs9) lwidth(medium) lpattern(longdash_dot)
>         xtitle("") xline(1, lcolor(gs8) lpattern(dash)) title("X1 (AL)")
>         legend(label(1 "Full Info. Strat. Logit") label(2 "Strat. Logit Part. Obs.") 
>                    label(3 "Split-Sample Logit") label(4 "Traditional Logit") symx(*.5))
>         ylabel("");

.         graph save Strat_x1_AL_compare_ss, replace;
(note: file Strat_x1_AL_compare_ss.gph not found)
(file Strat_x1_AL_compare_ss.gph saved)

.         #delimit;
delimiter now ;
. twoway kdensity X2_sl_ARr, scheme(s1color) color(black) lwidth(thin) lpattern(solid)
>         || kdensity X2_slpo_ARr, color(black) lwidth(thick) lpattern(solid)
>         || kdensity X2_ssl_Out, color(gs5) lwidth(medium) lpattern(dash)
>         || kdensity X2_l, color(gs9) lwidth(medium) lpattern(longdash_dot)
>         xtitle("") xline(1, lcolor(gs8) lpattern(dash)) title("X2 (ARr)")
>         legend(label(1 "Full Info. Strat. Logit") label(2 "Strat. Logit Part. Obs.") 
>                    label(3 "Split-Sample Logit") label(4 "Traditional Logit") symx(*.5))
>         ylabel("");

.         graph save Strat_x2_ARr_compare_ss, replace;
(note: file Strat_x2_ARr_compare_ss.gph not found)
(file Strat_x2_ARr_compare_ss.gph saved)

. #delimit;
delimiter now ;
. twoway kdensity C_sl_ARr, scheme(s1color) color(black) lwidth(thin) lpattern(solid)
>         || kdensity C_slpo_ARr, color(black) lwidth(thick) lpattern(solid)
>         || kdensity C_ssl_Rel, color(gs5) lwidth(medium) lpattern(dash)
>         xtitle("") xline(1, lcolor(gs8) lpattern(dash)) title("Xc (ARr)")
>         legend(label(1 "Full Info. Strat. Logit") label(2 "Strat. Logit Part. Obs.") 
>                    label(3 "Split-Sample Logit")  symx(*.5))
>         ylabel("");

.         graph save Strat_c_ARr_compare_ss, replace;
(note: file Strat_c_ARr_compare_ss.gph not found)
(file Strat_c_ARr_compare_ss.gph saved)

.         #delimit;
delimiter now ;
. twoway kdensity Z1_sl_BRr, scheme(s1color) color(black) lwidth(thin) lpattern(solid)
>         || kdensity Z1_slpo_BRr, color(black) lwidth(thick) lpattern(solid)
>         || kdensity Z1_ssl_Out, color(gs5) lwidth(medium) lpattern(dash)
>         || kdensity Z1_l, color(gs9) lwidth(medium) lpattern(longdash_dot)
>         xtitle("") xline(1, lcolor(gs8) lpattern(dash)) title("X3 (Br)")
>         legend(label(1 "Full Info. Strat. Logit") label(2 "Strat. Logit Part. Obs.") 
>                    label(3 "Split-Sample Logit") label(4 "Traditional Logit") symx(*.5))
>         ylabel("");

.         graph save Strat_z1_BRr_compare_ss, replace;
(note: file Strat_z1_BRr_compare_ss.gph not found)
(file Strat_z1_BRr_compare_ss.gph saved)

.         #delimit;
delimiter now ;
. twoway kdensity C_sl_BRr, scheme(s1color) color(black) lwidth(thin) lpattern(solid)
>         || kdensity C_slpo_BRr, color(black) lwidth(thick) lpattern(solid)
>         || kdensity C_ssl_Out, color(gs5) lwidth(medium) lpattern(dash)
>         || kdensity C_l, color(gs9) lwidth(medium) lpattern(longdash_dot)
>         xtitle("") xline(1, lcolor(gs8) lpattern(dash)) title("Xc (Br)")
>         legend(label(1 "Full Info. Strat. Logit") label(2 "Strat. Logit Part. Obs.") 
>                    label(3 "Split-Sample Logit") label(4 "Traditional Logit") symx(*.5))
>         ylabel("");

.         graph save Strat_c_BRr_compare_ss, replace;
(note: file Strat_c_BRr_compare_ss.gph not found)
(file Strat_c_BRr_compare_ss.gph saved)

.                         #delimit;
delimiter now ;
. grc1leg Strat_x1_AL_compare_ss.gph Strat_x2_ARr_compare_ss.gph Strat_c_ARr_compare_ss.gph
>                 Strat_z1_BRr_compare_ss.gph Strat_c_BRr_compare_ss.gph,
>         scheme(s1color) xcommon col(3) holes(4)
>         title("")       l1title("Kernel Density")
>         leg(Strat_x1_AL_compare_ss.gph)
>         b1title("Coefficient") imargin(tiny)
>         note("Note: Dashed vertical line represents the equation's true coefficient. Results of 1000 simulations with" 
>                  "2000 observations each. Bij represents the estimated coeffient for regressor Xij, where i is the actor"
>                  "and j is the outcome. Xc is a common regressor that appears in each actor's utility. Because the"
>                  "traditional and split-sample logit models estimate less parameters, they do not appear in each graph.");

.                 graph save Strat_Coef_compare_ss, replace;
(note: file Strat_Coef_compare_ss.gph not found)
(file Strat_Coef_compare_ss.gph saved)

.                 graph export Strat_Coef_compare_ss.eps, replace;
(note: file Strat_Coef_compare_ss.eps not found)
(file Strat_Coef_compare_ss.eps written in EPS format)

.                         log off;
      name:  <unnamed>
       log:  C:\Users\mdnieman\Desktop\SS Rep\SMPO_MC_SS.log
  log type:  text
 paused on:  29 May 2018, 16:33:27
------------------------------------------------------------------------------------------------------------------------------------------
